package com.example.PriceCompare;

import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;


public class ChangeStore extends ListActivity {
	 public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        String[] countries = getResources().getStringArray(R.array.StoreName);
	        this.setListAdapter(new ArrayAdapter<String>(this,
					android.R.layout.simple_list_item_1, countries));
	 }
	 @Override
		protected void onListItemClick(ListView l, View v, int position, long id) {
			super.onListItemClick(l, v, position, id);
			// Get the item that was clicked
			Object o = this.getListAdapter().getItem(position);
			String keyword = o.toString();
			Intent intent = new Intent();
			intent.putExtra("storename", keyword);
	 	    setResult(Activity.RESULT_OK,intent);
	 	    this.finish();
			
//			Toast.makeText(this, "You selected: " + keyword, Toast.LENGTH_LONG)
//					.show();
		}
}
